<template>
    <div class=" displayFlexC" style="flex: 1">
        <!-- <div class="tenAccountList-top">
            <span style="float:left;line-height:40px;margin-right:10px;">全表搜索：</span>
            <el-input v-model="searchVal" placeholder="" @input="searchEvents" prefix-icon="el-icon-search"></el-input>
        </div> -->
        <el-table
        :header-cell-style="{background:'RGB(248,248,249)'}"
        :data="tableData"
        border
        show-summary
        style="width:100%;">
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column prop="parkName" label="园区名称"></el-table-column>
            <el-table-column prop="firmName" label="企业名称"> </el-table-column>
            <el-table-column prop="underCollege" label="专科以下"> </el-table-column>
            <el-table-column prop="college" label="专科"> </el-table-column>
            <el-table-column prop="regularCollege" label="本科"> </el-table-column>
            <el-table-column prop="master" label="硕士"> </el-table-column>
            <el-table-column prop="doctor" label="博士"> </el-table-column>
        </el-table>
        <!-- 分页 -->
        <vxe-pager
        perfect
        size="mini"
        :current-page="tablePage.currentPage"
        :page-size="tablePage.pageSize"
        :page-sizes="tablePage.pageSizes"
        :total="tablePage.totalResult"
        :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Total']">
        </vxe-pager>
    </div>
</template>
<style lang="scss" scoped>
@import '../../../styles/all.scss';
</style>
<script>
import { getDataFillingInfoByeducation, getParkInfoById } from '@/api/Data_filling'
import XEUtils from 'xe-utils'
export default {
    props: {
    },
    components:{},
    data(){
        return{
            // 搜索-表格
            // searchVal: '',
            loading: false,
            tableData: [],
            list: [],
            // 分页
            tablePage: {
                currentPage: 1,
                pageSize: 15,
                pageSizes: [15, 30, 45, 60],
                totalResult: 0
            },
            checkedBoxList: [],
        }
    },
    watch:{
    },
    methods:{
        // 初始化
        init(page, limit){
            getDataFillingInfoByeducation(page, limit).then(res => {
                console.log("学历", res)
                this.list = res.data
                this.tableData = this.list
                this.tablePage.totalResult = res.count
                // this.list.forEach(ele => {
                //     getParkInfoById(ele.parkId).then(res => {
                //         console.log("园区信息", res)
                //         ele.parkName = res.data.name
                //     })
                // })
            })
 
        },
        selectAllEvent ({ checked, records }) {
            this.checkedBoxList = records
            // 全选
            console.log(checked ? '所有勾选事件' : '所有取消事件', records)
        },
        selectChangeEvent ({ checked, records }) {
            this.checkedBoxList = records
            // 单选个
            console.log(checked ? '勾选事件' : '取消事件', records)
        },
        // 搜索
        // searchEvents () {
        //     const filterVal = XEUtils.toValueString(this.searchVal).trim().toLowerCase()
        //     const filterRE = new RegExp(filterVal, 'gi')
        //     const searchProps = ['number', 'pname', 'versions', 'price', 'sname', 'time', 'count', 'userName']
        //     const rest = this.list.filter(item => searchProps.some(key => XEUtils.toValueString(item[key]).toLowerCase().indexOf(filterVal) > -1))
        //     this.tableData = rest.map(row => {
        //         const item = Object.assign({}, row)
        //         searchProps.forEach(key => {
        //         item[key] = XEUtils.toValueString(item[key]).replace(filterRE, match => `${match}`)
        //         })
        //         return item
        //     })
        // },
        // 表内查找
        // customStringFilterMethod ({ option, row, column }) {
        //     if (option.data) {
        //     return XEUtils.toValueString(row[column.property]).toLowerCase().indexOf((option.data).toLowerCase()) > -1
        //     }
        //     return true
        // },
        // filterEvent (option) {
        //     const xTable = this.$refs.xTable
        //     // 设置为选中状态
        //     option.checked = true
        //     // 修改条件之后，需要手动调用 updateData 处理表格数据
        //     xTable.updateData()
        // },
        
    },
    created(){
    },
    mounted(){
        this.init(this.tablePage.currentPage, this.tablePage.pageSize)
    },
}
</script>